import matplotlib.pyplot as plt
import numpy as np
from numpy import array
from datetime import datetime
from time import strftime
import random
import csv

if __name__ == "__main__":
    '''
    ID_1 = [923, 8, 919, 921, 947, 924, 915, 916, 953, 844]
    ID_2 = [443, 442, 88, 369, 70, 87, 69]
    ID_3 = [887, 888, 889, 886, 178, 177, 995, 13, 890, 199, 198, 174, 877, 882]
    ID_4 = [339, 63, 344, 341, 336, 342, 338, 340, 337, 259, 352, 343, 333, 345, 268]
    ID_5 = [180]
    ID_6 = [476, 475, 577]
    ID_7 = [812, 866, 159, 160, 967, 972]
    '''
    ID_1 = [549, 544, 504, 547, 545, 505, 107,
                          497, 548, 506, 507, 101, 553, 539,
                          552, 502, 546, 537, 498, 509, 543,
                          108, 642, 501, 538, 641, 508, 512,
                          558, 100, 503, 542, 496, 638, 640,
                          428, 514, 550, 556, 106, 554, 551, 23,
                          424, 124, 432, 555, 499, 639, 648,
                          540, 425, 417, 513, 495, 557, 541,
                          636, 490, 634, 500, 421, 511, 420,
                          643, 433, 534, 510, 559, 635, 430,
                          629, 563, 83, 492, 422, 416, 650, 125,
                          123, 426, 646, 637, 435, 630, 536,
                          427, 102, 633, 626, 560, 24, 491, 419,
                          415, 531, 84, 688, 434, 649, 5, 533,
                          109, 694, 632, 82, 644, 423, 414, 631,
                          686, 439, 655, 696, 645, 647, 429,
                          410, 628, 383, 698, 682, 515, 384,
                          494, 562, 418, 692, 385, 387, 690,
                          535, 413, 132, 85, 627, 532, 122, 493,
                          431, 437, 561, 382, 391, 484, 516,
                          567, 654, 386, 393, 691, 126, 683,
                          379, 674, 411, 695, 689, 566, 518,
                          651, 685, 520, 131, 20, 701, 678, 697,
                          438, 412, 525, 74, 568, 687, 73, 615,
                          693, 624, 488, 652, 702, 81, 705, 75,
                          671, 436, 677, 380, 395, 483, 110,
                          653, 622, 99, 684, 517, 389, 377, 681,
                          616, 699, 621, 707, 381, 396, 528,
                          406, 133, 374, 388, 658, 565, 781,
                          105, 679, 620, 673, 780, 784, 656,
                          103, 706, 121, 405, 680, 440, 489,
                          487, 703, 789, 390, 485, 21, 527, 785,
                          675, 712, 313, 521, 619, 376, 708, 72,
                          378, 778, 526, 80, 625, 392, 394, 564,
                          524, 127, 318, 571, 398, 774, 86, 76,
                          672, 149, 574, 704, 618, 150, 779,
                          700, 486, 312, 404, 148, 676, 777,
                          657, 482, 409, 786, 617, 530, 375,
                          321, 710, 709, 441, 788, 529, 610,
                          782, 309, 407, 30, 317, 147, 659, 623,
                          776, 572, 519, 71, 151, 397, 613, 481,
                          4, 770, 614, 60, 783, 308, 792, 307,
                          772, 373, 773, 661, 670, 570, 371,
                          323, 790, 61, 315, 444, 98, 711, 134,
                          787, 104, 306, 311, 316, 806, 59, 408,
                          796, 314, 372, 130, 77, 322, 522, 569,
                          319, 612, 573, 479, 775, 442, 803,
                          157, 771, 611, 31, 310, 663, 290, 662,
                          295, 794, 369, 660, 304, 808, 791, 79,
                          324, 399, 523, 579, 146, 293, 53, 158,
                          22]
    ID_2 = [814, 813, 171, 815, 811]
    ID_3 = [991]
    ID_4 = [902, 181, 903, 867, 182, 900, 901, 864]
    ID_5 = [454, 457, 453, 92, 458, 456, 461, 452]
    #p_value = [0.00000015, 0.0000047, 0.000019, 0.015, 0.671, 0.768, 0.997]
    p_value = [0.000039, 0.038, 0.599, 0.996, 0.999]
    output_csv = np.ones((1000,2))
    output_csv[:,0] = range(1000)
    for item in output_csv:
        if int(item[0]) in ID_1:
            item[1] = p_value[0]
        if int(item[0]) in ID_2:
            item[1] = p_value[1]
        if int(item[0]) in ID_3:
            item[1] = p_value[2]
        if int(item[0]) in ID_4:
            item[1] = p_value[3]
        if int(item[0]) in ID_5:
            item[1] = p_value[4]
            '''
        if int(item[0]) in ID_6:
            item[1] = p_value[5]
        if int(item[0]) in ID_7:
            item[1] = p_value[6]
            '''
    print ID_1

    filepath = 'c:/temp.csv'
    np.savetxt(filepath, output_csv, delimiter=',')
